package learn;

public class car {
    String carName;
    int carAge;


    public void show(car this){
        System.out.println(this.carName);

        //调用内部类的成员 必须先创建对象通过对象去访问内部类的成员
        Engine e=new Engine();
        System.out.println(e.engineName);
    }

    private class Engine{
        String engineName;
        int engineAge;

        public void show(){
            System.out.println(engineName);
            System.out.println(carName);
        }

    }

    public Engine getEngine(){
        return new Engine();
    }

}
